const OSS = require("ali-oss");
const path = require("path");
const {getFileName} = require('../utils/utils')


module.exports = async function({
    config,
    ossName,
    localPath,
}){
    const ossConfig = config?config:this.getOssConfig()
    const client = new OSS(ossConfig);
    const inputlocalPath = localPath?path.resolve(localPath):path.resolve(getFileName(ossName)) 
    await client.get(ossName,inputlocalPath)
}